package smsverificationci;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class IpConfiguration implements ApplicationListener<WebServerInitializedEvent>{
    @Getter@Setter
    private int port;

    @Override
    public void onApplicationEvent(WebServerInitializedEvent webServerInitializedEvent) {
        setPort(webServerInitializedEvent.getSource().getPort());
    }
}
